package com.fengwk.support.spring.boot.config;

import java.util.HashMap;
import java.util.Map;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;

import com.fengwk.support.filter.CustomHttpSessionFilter;

public abstract class AbstractCloseHttpSessionFilter {

	@Bean
	protected FilterRegistrationBean createCloseHttpSessionFilter() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new CustomHttpSessionFilter());
        Map<String, String> initParameters = new HashMap<String, String>();
        initParameters.put("openSession", "false");
        registration.setInitParameters(initParameters);
        registration.addUrlPatterns("/*");
        return registration;
    }
	
}
